package com.homelock.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.homelock.service.RemoteUnlockService;
import com.pi.base.dto.result.AppResult;
import com.pi.http.base.controller.BaseController;

@RequestMapping("/lock/control")
@RestController
public class RemoteUnlockController extends BaseController {

    private RemoteUnlockService remoteUnlockService;

    public RemoteUnlockController(RemoteUnlockService remoteUnlockService) {
        this.remoteUnlockService = remoteUnlockService;
    }

    @RequestMapping("/remote_unlock")
    public AppResult remoteUnlock(Long devId) {
        remoteUnlockService.remoteUnlock(devId, getLoginUserId());
        return AppResult.OK;
    }
}
